import { VxeGridProps } from 'vxe-table';
import { BizOrderVo } from '@/api/operation/order/types';

export function getTableConfig(): VxeGridProps<BizOrderVo> {
  return {
    id: 'tenant',
    loading: false,
    height: 'auto',
    autoResize: true,
    border: 'inner',
    resizable: true,
    showOverflow: 'tooltip',
    stripe: true,
    rowConfig: {
      isHover: true,
      keyField: 'id'
      // height: 56
    },
    customConfig: {
      storage: true
    },
    columns: [
      { title: '序号', fixed: 'left', type: 'seq', width: 50 },
      { sortable: true, fixed: 'left', resizable: false, field: 'orderId', title: '订单单号', width: 160 },
      { sortable: true, fixed: 'left', resizable: false, field: 'vendorName', title: '酒店名称', minWidth: 150 },
      { sortable: true, resizable: false, field: 'room', minWidth: 50, title: '房号' },
      { sortable: true, resizable: false, field: 'roomPosition', minWidth: 50, title: '位置', slots: { default: 'position' } },
      { sortable: true, resizable: false, field: 'orderType', minWidth: 50, title: '订单类型', slots: { default: 'type' } },
      { sortable: true, field: 'payTime', minWidth: 150, title: '支付时间' },
      { sortable: true, field: 'chooseTime', minWidth: 70, title: '时长(秒)' },
      { sortable: true, field: 'remainTime', minWidth: 70, title: '剩余时长(秒)' },
      { sortable: true, field: 'totalOrderAmount', minWidth: 70, title: '应付金额(元)', slots: { default: 'orderAmount' } },
      { sortable: true, field: 'refundAmount', minWidth: 70, title: '退款金额(元)', slots: { default: 'refundAmount' } },
      { sortable: true, resizable: false, field: 'status', minWidth: 80, title: '状态', slots: { default: 'status' } },
      { sortable: true, field: 'deviceId', minWidth: 180, title: '设备 id' },
      { sortable: true, field: 'openTime', minWidth: 130, title: '开始时间' },
      { sortable: true, field: 'endTime', minWidth: 120, title: '预期结束时间' },
      { sortable: true, field: 'useTime', minWidth: 80, title: '使用时长(秒)' },
      { sortable: true, field: 'hasAccessory', minWidth: 180, title: '是否购买鼻氧管', slots: { default: 'hasAccessory' } },

      // { field: 'regionName', minWidth: 180, title: '区域' },
      // { field: 'totalOrderActualPayment', minWidth: 80, title: '实付金额(元)', slots: { default: 'orderActualPayment' } },
      // { field: 'closeTime', minWidth: 130, title: '结束时间' },
      // { field: 'openid', minWidth: 130, title: 'openid' },
      { field: 'handle', fixed: 'right', title: '操作', width: '140px', slots: { default: 'handle' } }
    ],
    data: [] as BizOrderVo[]
  };
}
